<template>
  <div>
    
    <van-sticky>
      <van-nav-bar
        right-text="确定"
        left-arrow
        @click-left="onClickLeft"
        @click-right="onClickRight"
      />
    </van-sticky>
    

    <div style="padding: 0 5%">
      <h2>我的优势</h2>
      <p>一句话介绍自己，突出核心优势</p>
    </div>
    <van-field
      style="fontsize: 16px"
      v-model="message"
      rows="2"
      autosize
      size="large"
      type="textarea"
      maxlength="200"
      placeholder="请输入个人优势"
      show-word-limit
    />
  </div>
</template>


<script>
import { Dialog } from "vant";
// import { Loading } from 'vant';

export default {
  components: {
    [Dialog.Component.name]: Dialog.Component,
  },
  data() {
    return {
      value: "",
      message: "",
      user_id: "",
    };
  },
  mounted() {
    this.user_id = localStorage.getItem("userId");
    this.axios({
      method: "post",
      url: "http://localhost:3000/sel_resume",
      data: {
        user_id: this.user_id,
      },
    }).then((res) => {
      let data = res.data.data[0];
      this.message = data.jl_describe;
    });
  },

  methods: {
    onClickLeft() {
      Dialog.confirm({
        message: "是否退出编辑",
      })
        .then(() => {
          this.$router.go(-1);
        })
        .catch(() => {
          // on cancel
        });

      //   confirm("确定返回");
    },
    onClickRight() {
      //   console.log(222222);
      // console.log(this.message);
      this.axios({
        method: "post",
        url: "http://localhost:3000/update_advan",
        data: {
          user_id: this.user_id,
          text: this.message,
        },
      });
      this.$router.go(-1);
    },
  },
};
</script>


<style scoped>
/deep/.van-nav-bar__text {
  color: black;
}
/deep/.van-nav-bar__arrow {
  color: black;
}
input {
  width: 100%;
  height: 100px;
  /* border: none; */
}
</style>